package Demo_zhuanshu.XueQiang07;
 
public class Singleton1 {
    public static void main(String[] args) {
        Singleton instance = Singleton.getInstance();
        Singleton instance2 = Singleton.getInstance();
        if (instance==instance2){
            System.out.println("true");
        }else {
            System.out.println("false");
        }
 
    }
}
 
class Singleton {

    private Singleton(){
 
    }

    private final  static Singleton instance = new Singleton();
 
 
    public static Singleton getInstance(){
        return instance;
    }
}